yjx.controller('profileController',['$rootScope','$scope','$fetch','$state','modalService','$timeout',function($rootScope,$scope,$fetch,$state,modalService,$timeout) {
    $rootScope.tabCtrlName = $rootScope.tabCtrlNameArr[3];
    var editApi = '/user/updateMyInfo';
    $scope.digests = $rootScope.digests?$rootScope.digests:'';
    $scope.alipayAccount = $rootScope.alipayAccount?$rootScope.alipayAccount:'';
    $scope.edit = function() {
        $fetch.fetch(
            editApi,
            {
                params:{
                    id:$rootScope.userId,
                    digests:$scope.digests,
                    alipayAccount:$scope.alipayAccount,
                },
                type:'post'

            }
        ).then(function(data){
             $timeout(function(){
                 $rootScope.digests  = $scope.digests;
                 $rootScope.alipayAccount =  $scope.alipayAccount;
                 history.back();
             })
            }).catch(function(e){
                modalService.mainMsgError(e.msg);
            })
    }
}])